import http from '/@/utils/http';

/**
 * 设备备件管理api接口集合
 * @method getSpareInfoApi 备件管理/获取备件详情
 * @method savePartApi 备件管理/新增备件
 * @method getBatchApi 通过备件id获取批次号
 * @method savePartRetrievalApi 备件管理/出库
 * @method savePartBatchApi 备件管理/新增批次
 * @method savePartWarehouseApi 备件管理/入库
 * @method updatePartApi 备件管理/修改备件
 * @method getOutInfoApi 备件管理/出库详情
 * @method getInInfoApi 备件管理/入库详情
 * @method downloadTemplateApi 备件管理/模板导出
 * @method getInfoApi 备件申请管理/获取详情
 * @method devicePartApplyGetApplyInfoApi 备件申请/获取申请处理详情（推荐批次）
 * @method devicePartGetApplyDetailInfoApi 备件申请/获取申请详情处理详情（推荐批次）
 * @method auditPartApplyApi 备件申请管理/审核备件申请
 * @method auditPartApplyDetailApi 备件申请管理/审核备件申请详情
 * @method getApplyByOrderNumApi 通过工单号获取前用户的备件申请单号
 * @method getUsageByApplyNumApi 获取该备件申请的备件实际使用详情（按照备件总数返回）
 * @method getUsageDetailByApplyNumApi 获取备件申请的备件实际使用详情（按照批次号数量返回）
 * @method savePartRefundApi 备件退还管理/新增备件退还
 * @method savePartRefundAndWarehouseApi 备件退还管理/添加备件退还
 * @method devicePartRefundGetInfoApi 备件退还管理/查看详情
 * @method getPartRefundDealApi 备件退还管理/查看详情
 * @method refundAuditPartApplyApi 备件退还管理/添加备件退还
 * @method derivedRecordApi 出入库记录/导出出库记录
 * @method derivedRecordInApi 出入库记录/导出入库记录
 * @method importPartExpertApi 备件管理/批量导入
 * @method singleDerivedRecordInApi 备件管理/单个备件入库导出记录
 * @method singleDerivedRecordApi 备件管理/单个备件出库导出记录
 */

export const getSpareInfoApi = async (params: any) => {
    return await http.get(`/device/mobile/devicePart/getInfo/${params}`)
}

export const savePartApi = async (params: any) => {
    return await http.post(`/device/mobile/devicePart/savePart`, params)
}

export const getBatchApi = async (id: any, type: any) => {
    return await http.get(`/device/mobile/devicePartBatch/getPartBatchList/${id}/${type}`)
}

export const savePartRetrievalApi = async (params: any) => {
    return await http.put(`/device/mobile/devicePartRetrieval/savePartRetrieval`, params)
}

export const savePartBatchApi = async (params: any) => {
    return await http.post(`/device/mobile/devicePartBatch/insertPartBatch`, params)
}

export const savePartWarehouseApi = async (params: any) => {
    return await http.put(`/device/mobile/devicePartWarehouse/savePartWarehouse`, params)
}

export const updatePartApi = async (params: any) => {
    return await http.put(`/device/mobile/devicePart/updatePart`, params)
}

export const getOutInfoApi = async (id: any) => {
    return await http.get(`/device/mobile/devicePartRetrieval/getInfo/${id}`)
}

export const getInInfoApi = async (id: any) => {
    return await http.get(`/device/mobile/devicePartWarehouse/getInfo/${id}`)
}

export const getInfoApi = async (id: any) => {
    return await http.get(`/device/mobile/devicePartApply/getInfo/${id}`)
}

export const devicePartGetApplyInfoApi = async (id: any) => {
    return await http.get(`/device/mobile/devicePartApply/getApplyInfo/${id}`)
}

export const devicePartGetApplyDetailInfoApi = async (detailId: any) => {
    return await http.get(`/device/mobile/devicePartApply/getApplyDetailInfo/${detailId}`)
}

export const getPartRefundDealApi = async (id: any) => {
    return await http.get(`/device/mobile/devicePartRefund/getPartRefundDeal/${id}`)
}

export const auditPartApplyApi = async (params: any) => {
    return await http.put(`/device/mobile/devicePartApply/auditPartApply`, params)
}

export const auditPartApplyDetailApi = async (params: any) => {
    return await http.put(`/device/mobile/devicePartApply/auditPartApplyDetail`, params)
}

export const getApplyByOrderNumApi = async (params: any) => {
    return await http.post(`/device/mobile/devicePartApply/getApplyByOrderNum`, params)
}

export const getUsageByApplyNumApi = async (ApplyNum: any) => {
    return await http.get(`/device/mobile/devicePartUsage/getUsageByApplyNum/${ApplyNum}`)
}

export const getUsageDetailByApplyNumApi = async (ApplyNum: any) => {
    return await http.get(`/device/mobile/devicePartUsage/getUsageDetailByApplyNum/${ApplyNum}`)
}

export const savePartRefundApi = async (params: any) => {
    return await http.post(`/device/mobile/devicePartRefund/savePartRefund`, params)
}

export const savePartRefundAndWarehouseApi = async (params: any) => {
    return await http.post(`/device/mobile/devicePartRefund/savePartRefundAndWarehouse`, params)
}

export const devicePartRefundGetInfoApi = async (params: any) => {
    return await http.get(`/device/mobile/devicePartRefund/getInfo/${params}`)
}

export const refundAuditPartApplyApi = async (params: any) => {
    return await http.put(`/device/mobile/devicePartRefund/auditPartApply`, params)
}

export const downloadTemplateApi = async () => {
    return await http.postBlob(`/device/mobile/devicePart/downloadTemplate`)
}

export const derivedRecordApi = async (params: any) => {
    return await http.postBlob(`/device/mobile/devicePartRetrieval/derivedRecord`, params)
}

export const derivedRecordInApi = async (params: any) => {
    return await http.postBlob(`/device/mobile/devicePartWarehouse/derivedRecord`, params)
}

export const importPartExpertApi = async (params: any) => {
    return await http.postUpload(`/device/mobile/devicePart/importPartExpert`, params)
}

export const singleDerivedRecordApi = async (params: any) => {
    return await http.postBlob(`/device/mobile/devicePartRetrieval/singleDerivedRecord`, params)
}

export const singleDerivedRecordInApi = async (params: any) => {
    return await http.postBlob(`/device/mobile/devicePartWarehouse/singleDerivedRecord`, params)
}

// export const getApplyInfoApi = async (ApplyNum: any) => {
//     return await http.get(`/device/mobile/devicePartApply/getApplyInfo/${ApplyNum}`)
// }

// export const getApplyDetailInfoApi = async (ApplyNum: any) => {
//     return await http.get(`/device/mobile/devicePartApply/getApplyDetailInfo/${ApplyNum}`)
// }